package cn.itheima.student.dao.impl;

import java.sql.SQLException;

import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanHandler;

import cn.itheima.student.dao.LoginDao;
import cn.itheima.student.daomain.Student;
import cn.itheima.student.daomain.admin;
import cn.itheima.student.utils.JDBCUtils;

public class LoginDaoImpl implements LoginDao {

	
	public admin Loginadmin(int id, String epss) {

		QueryRunner runner = new QueryRunner(JDBCUtils.getDataSource());
		
		String sql = "select * from admin where id = ? and pass = ?";
		
		try {
			admin stu = runner.query(sql, new BeanHandler<admin>(admin.class),id,epss);
			return stu;
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return null;
	}

	
}
